package com.code.springbootquartz.init;

import com.code.springbootquartz.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/*
 * 项目启动成功后遍历CommandLineRunner接口的所有实现，并执行run方法
 * @author: liyufei
 * @date: 2018-07-14 11:18
 */
@Component
public class TriggerStartupRunner implements CommandLineRunner {

    @Autowired
    private TestService testService;

    @Override
    public void run(String... strings) throws Exception {
        testService.test();
    }
}
